
#include <stdio.h>
#include <stdlib.h>
#include "calc.h"


int main(int argc,char*argv[])
{
    int a = 0;
    int b = 0;
    int c = 0;
    int e = 0;
    float d=0;
if(argc <4)
{
printf("usage : ./calc paral para2\n");
return 1;
}

a =atoi(argv[1]);
b =atoi(argv[2]);
e=atoi(argv[3]);
switch(e)
{
case 1:
c = add(a,b);
printf("%d + %d = %d \n", a, b, c);
break;
case 2:
c = sub(a,b);
printf("%d - %d = %d \n", a, b, c);
break;
case 3:
c = mul(a,b);
printf("%d x %d = %d \n", a, b, c);
break;
case 4:
d = dive(a,b);
printf("%d / %d = %f \n", a, b, d);
break;
default: printf("不存在该选项\n");
}
   return 0;
}
